
package data;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMessage;
import javax.servlet.http.HttpServletRequest;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionMapping;
/**
 *
 * @author Alejandro
 */
public class ModificarBitacora2Form extends ActionForm{
    private String ID;

    public ModificarBitacora2Form(){
        
    }
    
    public void setID(String ID) {
        this.ID = ID;
    }

    public String getID() {
        return ID;
    }
    
    @Override
    public void reset(ActionMapping mapping, HttpServletRequest request){
        this.ID = null;
    }
    
    @Override
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
         
        BitacoraDataMapper mapper = new BitacoraDataMapper();
        if (!mapper.verificarIDBitacora(ID)) {
            errors.add("ID", new ActionMessage("error.id.nonexistent"));
        }
        return errors;
    }
}